
package com.idealighter.game.games.texaspoker.handler;

import com.idealighter.game.core.annotation.ResMsgHandler;
import com.idealighter.game.gamehall.dto.SeatInfo;
import com.idealighter.game.games.texaspoker.TexaspokerPlayer;
import com.idealighter.game.games.texaspoker.message.ResWinMsg;
import com.idealighter.game.message.core.ResMessage;
import com.idealighter.game.robot.core.Player;
import com.idealighter.game.robot.handler.ResMessageHandler;


@ResMsgHandler(505226)
public class ResWinHandler implements ResMessageHandler {

  // private static final Logger LOG = LoggerFactory.getLogger(ResWinHandler.class);

  @Override
  public void action(Player player, ResMessage message) {
    ResWinMsg msg = (ResWinMsg) message;
    TexaspokerPlayer texaspokerPlayer = (TexaspokerPlayer) player;
    SeatInfo seat = texaspokerPlayer.seat(player.playerId);
    if (seat.getOrder() == msg.getOrder()) {
      texaspokerPlayer.domain.setWin(1);
    }
  }
}
